import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Leet1291 {
    public static void main(String[] args) {
        System.out.println(sequentialDigits(1000,130000000));
    }
    static public List<Integer> sequentialDigits(int low, int high) {
        List<Integer> list = new ArrayList<>();
        int tem = low;
        int wei = 0;
        int dw = 0;
        while (tem!=0){
            tem/=10;
            wei++;
        }
        tem = high;
        while (tem!=0){
            tem/=10;
            dw++;
        }
        for (int i = 1; i <= 10-wei; i++) {
            StringBuilder sb = new StringBuilder();
            for (int j = i; j < i+wei; j++) {
                sb.append(j);
            }
            int t = Integer.parseInt(sb.toString());
            if (t<=high&&t>=low)
                list.add(t);
            for (int j = i+wei; j <= Math.min(9,i+dw); j++) {
                sb.append(j);
                t = Integer.parseInt(sb.toString());
                if (t<=high&&t>=low)
                    list.add(t);
            }
        }
        Collections.sort(list);
        return list;
    }
}
